package com.lie.prepare.multi_thread.join;

/**
 * Created by lie on 2018/4/9.
 */
public class Sleeper extends Thread {

    private int duration;

    public Sleeper(String name, int duration) {
        super(name);
        this.duration = duration;
        start();
    }

    public void run(){
        try {
            sleep(duration);
        } catch (InterruptedException e) {
            System.out.println(getName() + " Sleeper线程sleep被打断");
            return;
        }
        System.out.println(getName()+ "睡眠完整结束");
    }
}
